add fix & test for humminbird route writer. (#1324)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Fri, 16 Aug 2024 01:45:38 +0000 (19:45 -0600)
committerGitHub <noreply@github.com>
Fri, 16 Aug 2024 01:45:38 +0000 (19:45 -0600)
The missing initialization was introduced in 824e01d.

humminbird.cc
reference/route/humminbird_gpsbabel.hwr [new file with mode: 0644]
testo.d/humminbird.test

index 3d66cc0584cc5870c7aad661721244074ebcf666..f829cc796754c93e15fbfcf0e3fd0fd3333bd0d9 100644 (file)
@@ -805,7 +805,7 @@ HumminbirdFormat::humminbird_rte_head(const route_head* rte)
 {
   humrte = nullptr;
   if (!rte->rte_waypt_empty()) {
-    humrte = new humminbird_rte_t;
+    humrte = new humminbird_rte_t();
   }
 }
 
diff --git a/reference/route/humminbird_gpsbabel.hwr b/reference/route/humminbird_gpsbabel.hwr
new file mode 100644 (file)
index 0000000..f2f5a2b
Binary files /dev/null and b/reference/route/humminbird_gpsbabel.hwr differ
index 3604bc6bb370a57e042e5896832e5d53aa737689..eb143863add3d56b1ae19eb143a5a620cda4a2ce 100644 (file)
@@ -7,6 +7,21 @@ gpsbabel -i humminbird -f ${REFERENCE}/humminbird.hwr -o humminbird -F ${TMPDIR}
 bincompare ${REFERENCE}/humminbird.hwr ${TMPDIR}/humminbird.hwr
 gpsbabel -i humminbird -f ${REFERENCE}/route/humminbird.hwr -o gpx -F ${TMPDIR}/humminbird~hwr.gpx
 compare ${REFERENCE}/route/humminbird~hwr.gpx ${TMPDIR}/humminbird~hwr.gpx
+
+# The provenance of humminbird.hwr is unclear.
+# The routes have timestamps
+# 48 a8 59 72 (Sun Aug 17 2008 17:01:38 GMT+0000)
+# 48 a8 5a 77 (Sun Aug 17 2008 17:05:59 GMT+0000)
+# 48 a8 5a 80 (Sun Aug 17 2008 17:06:08 GMT+0000)
+# which suggests they may be real.
+# The unused entries in the points array of the route headers appear to be random.
+# To add regresssion for our writer we generated a corresponding hwr file with GPSBABEL_FREEZE_TIME=y
+# gpsbabel -i humminbird -f reference/route/humminbird.hwr -o humminbird -F reference/route/humminbird_gpsbabel.hwr
+# This has zeroed timestamps and zeroed unused entries in the points arrays.
+gpsbabel -i humminbird -f ${REFERENCE}/route/humminbird_gpsbabel.hwr -o humminbird -F ${TMPDIR}/humminbird_gpsbabel~hwr.hwr
+compare ${REFERENCE}/route/humminbird_gpsbabel.hwr ${TMPDIR}/humminbird_gpsbabel~hwr.hwr
+
+#
 #
 # Humminbird tracks
 #
@@ -27,3 +42,4 @@ compare ${REFERENCE}/humminbird-rte-v2~gpx.gpx ${TMPDIR}/humminbird-rte-v2~gpx.g
 
 gpsbabel -i humminbird -f ${REFERENCE}/humminbird-rte-v3.hwr  -o gpx,humminbirdextensions=1 -F ${TMPDIR}/humminbird-rte-v3~gpx.gpx
 compare ${REFERENCE}/humminbird-rte-v3~gpx.gpx ${TMPDIR}/humminbird-rte-v3~gpx.gpx 
+